home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1997 February / Software of the Month Club 1997 February.iso / pc / dos / sri / edu / alged33 / alged.doc < prev    next >
Encoding:
Text File  |  1996-04-23  |  12.6 KB  |  283 lines

  1. Tutorial for Algebra Editor           John Henckel, henckel@vnet.ibm.com
  2.  
  3. Copyright (c) 1994,1996 John Henckel
  4. Permission to use, copy, modify, distribute and sell this software
  5. and its documentation for any purpose is hereby granted without fee,
  6. provided that the above copyright notice appear in all copies and
  7. that both that copyright notice and this permission notice appear
  8. in supporting documentation.  All programs contained herein are provided
  9. to you "as is".  The implied warranties of merchantability and fitness
  10. for a particular purpose are expressly disclaimed.
  11.  
  12. Getting Started
  13. ---------------
  14. By now I assume you have downloaded the alged33.zip and unzipped it.  You
  15. should have the following files...
  16.  
  17.     setup.bat      <--- run this to change language and video
  18.     alged.exe      <--- the program
  19.     alged.ae       <--- sample data file
  20.     alged.1st      <--- user options file
  21.     alged.doc      <--- tutorial (this file)
  22.     algedeng.hlp   <--- online help
  23.     algedeng.hlq   <--- online help (graphics mode)
  24.     algedeng.mnu   <--- menu, text and keyboard definitions
  25.     svga.ae        <--- Super VGA 256 color option file
  26.     ned.ae         <--- Flemish option file
  27.     fra.ae         <--- French option file
  28.     algedned.*     <--- Flemish language data
  29.     algedfra.*     <--- French language data
  30.     algedsrc.zip   <--- source code
  31.     file_id.diz    <--- short description
  32.     vgaprtsc.*     <--- TSR print screen utility for 16 color VGA graphics
  33.     *.bgi          <--- various graphics drivers (Borland)
  34.  
  35. ===> If you prefer Flemish (Dutch) see the file algedned.doc. <===
  36.  
  37. The default language of the Alged program is English and
  38. the default graphics mode is "autodetect" up to 16 colors.
  39. To change the defaults, type
  40.  
  41.     setup
  42.  
  43. Before you run the Alged program, you might want to change the number of lines
  44. on the screen.  You can set this using the DOS command
  45.  
  46.     MODE co80,43
  47.  
  48. When you start Alged you may specify one or more data files or option files.
  49. The data file is just a text file you create with a text editor.  Start Alged
  50. with the sample data file...
  51.  
  52.     alged alged
  53.  
  54. You can use option files SVGA, NED, and FRA to change the language or graphics
  55. mode temporarily.  For example.
  56.  
  57.     alged alged svga
  58.  
  59. Now you should see a screen with a menu on the top and some formulas in the
  60. middle.  The first thing to learn is how to see the help text.  Press F1.
  61. The first part is a brief intro and how to use the mouse.  Then you see a
  62. description of each menu item.  Notice that each menu item has a hotkey.
  63.  
  64. Graphics
  65. --------
  66.  
  67. I know you all like graphics, so let's begin with some pretty pictures.
  68. The first formula you see is the following...
  69.  
  70.                                 2         2
  71.                         cos(x*2) *cos(y*2)  + r*0.2
  72.  
  73. What kind of function is this?  What does it look like?  A graph can help
  74. you quickly understand the properties of a function.  Click on Graph or
  75. press 'g' to graph this in two dimensions.  You see a cosine wave.  This is
  76. a cross-section of the function for values of x (because it is the first
  77. variable in the function).  To graph the other variables press 'V' (hold shift
  78. key).
  79.  
  80. The curve is rather jagged, so press [home] twice to add more points.  This
  81. draws the function slower but smoother.  Press [end] to remove points.
  82. You can press [ins] and [del] to zoom in or out.  You can press [pgup] and
  83. [pgdn] to stretch the function.  You can pan with the arrows.  You can press
  84. 'd' to return to the default view.
  85.  
  86. 3D graphics
  87. -----------
  88.  
  89. Now let's look at a 3-dimensional graph.  Press 'g' again.  You may need to
  90. press [home] or [end] to get a good picture.  Press [ins] one time to get
  91. closer.  You can see that this is a function like many mountains in straight
  92. rows.  Initially, the x-axis is pointing towards you, z points to the right
  93. and y points up.  If you have a color display, press 'c'.  Press 'f' to fill
  94. the graph.  Press 'f' again for a partially filled graph.  Press 'c' again to
  95. color the graph according the slope of the function, (see the ?r user option
  96. for the slope direction vector).
  97.  
  98. If you are using SVGA mode with 256 colors here are some treats for you.
  99. You can press 'x' to use a 240 color rainbow or 240 gray scale.  You can use
  100. the '-' and '=' key to cycle the palette.  Press them multiple times to cycle
  101. faster.  The 'z' key will scale the palette according to the range of the
  102. function so that all the colors are visible.  To view a shaded 3D graph, go to
  103. 3D mode and press 'dfxxcc' and press [home] to add points.
  104.  
  105. What would happen if you wrap this mountain function over a sphere?  Press
  106. 'a' to change to polar coordinates.  You may want to press [ins] to get
  107. closer.  The tick marks on the axes are units.  In polar mode, the x variable
  108. determines the latitude, and y determines the longitude.  The function value
  109. is the radius.  What about the other variable 'r'?  It is a free variable
  110. initially set to zero, (see upper left screen).  You can change the value
  111. of r by pressing 'w' and '2'.  What happens when r is 3? when r is -13?
  112.  
  113. Press F1 while in graphics mode to see more help about graphics keys (or look
  114. at the source code in algraph.c).
  115.  
  116. Parametric graphs
  117. -----------------
  118.  
  119. Press Esc to return to the main menu.  Now let's see a graph of a parametric
  120. function.  The next formula in the file is
  121.  
  122.                  cos(2*t) + sin(3*t + 0.2*u)
  123.  
  124. This formula describes the sound wave of a perfect fifth in music.  Press down
  125. arrow or click on the first '+' to select the formula, and press 'g' to graph
  126. it.  You can press 'w' and '2' to see the various phases.
  127.  
  128. What would happen if we plot the two components of this wave against each other
  129. on the x and y axes?  Press Esc to return to the main menu.  Click on the sin
  130. function with the left mouse button and click the cos function with the right
  131. mouse button.  (If you don't have a mouse, then press end, period, pgup, pgdn).
  132. The cos function is copied to the "key" at the bottom of the screen.  The key
  133. is used as the x axis function.  Press 'g' to view the graph, you should see
  134. the shape of a fish.  (If you don't see the fish press 'd' or 'a').  Now
  135. change the phase of the sine and see the effect.
  136.  
  137. Parametric graphs can also be useful in 3D.  The equation in the key is used
  138. to warp or even overlap the x coordinates.  You might try to put x + sin(y)
  139. in the key and then select and view the "mountains" function again.
  140.  
  141. Entering Formulas
  142. -----------------
  143.  
  144. Press Esc to return to the Alged main menu.  To enter your own formula into
  145. Alged, click on EnterKey or press 'k'.  Type a formula at the prompt, for
  146. example type...
  147.  
  148.     x + sin(y)
  149.  
  150. then press F6 (or ctrl-Z) and press Enter.  The formula appears at the bottom
  151. of the screen in the "key".  To move the key to the work space, click InsKey
  152. or press 'Ins', and press Enter.
  153.  
  154. When you are entering formulas, you can use the following keys
  155.         arrows = redo and undo a character
  156.         Insert = toggle insert mode
  157.         Delete = delete one character
  158.  
  159. The Alged formulas are stored in plain text files, so you can use any text
  160. editor to change or add formulas.
  161.  
  162. Solving Equations
  163. -----------------
  164.  
  165. Let's start with the next sample formula.
  166.  
  167.                      x*(5 + 2*x) - 2
  168.                     ----------------- - 2*x + 1 = 13
  169.                           3 + x
  170.  
  171. (It looks prettier than this if you use 8-bit ascii.)  To solve this
  172. problem, you need to find a common denominator for the left hand side.
  173. You can either click on the "Comm Deno" menu item or press the hotkey 'm'.
  174. The result is...
  175.  
  176.              x*(5 + 2*x) - 2 - 2*x*(3 + x) + 1*(3 + x)
  177.             ------------------------------------------- = 13
  178.                                3 + x
  179.  
  180. To complete the problem do the following
  181.  1. click on Distribute or press 'd'
  182.  2. click on Simplify or press space
  183.  3. click on EquLeft or press '[' to move the 1 across the equal
  184.  4. click on EquRight or press ']' to move the 3 across the equal
  185.  5. click on Simplify or press space. You should see  x = -2.92307692307692
  186.  6. click on Integer or press 'i' to convert to integer expression.
  187. The answer is -38/13.
  188.  
  189. You may be thinking "that was a lot of trouble to just solve for x" and you
  190. are right.  Mathematica can do it in one step.  But Alged is intentionally
  191. this way.  Rather than a long list of complicated transformations, Alged
  192. provides and short list of simple commands and a highly interactive user
  193. interface.  This is conducive to "playing" with the formulas creatively.
  194.  
  195. The next problem is to find the intersection of a parabola and a circle.
  196. In general, the solution would involve finding roots to a fourth degree
  197. polynomial.  This can be done, in theory, but for this tutorial we'll simplify
  198. the problem by constraining two of the roots.  Given a circle at the origin of
  199. radius r, and given a parabola that passes through the circle at (r,0) and
  200. (-r,0), at what other points does the parabola intersect the circle?  The
  201. equation of the circle is given by
  202.  
  203.                 2    2    2
  204.       (1)      x  + y  = r
  205.  
  206. The general form of the parabola is given by
  207.  
  208.                      / 2    2\
  209.       (2)      y = a*\r  - x /
  210.  
  211. To solve this we can eliminate y from (1) by substitution as follows
  212.  1. copy (2) to the Key by clicking on = with the right mouse button or
  213.     select it and press '.'.
  214.  2. select (1) by clicking on = with the left mouse button.
  215.  3. click on Substitut or press 'u'.
  216.  
  217. Subtract r^2 from both sides of (1) and simplify as follows
  218.  1. copy r^2 to the Key by clicking just ABOVE the r with the right mouse
  219.     button.  If you don't have a mouse: pgdn, period, pgup.
  220.  2. click on Subtr Key or press '-'.
  221.  3. click on ^N Expand or press 'n'.
  222.  4. click on Distribut or press 'd'.
  223.  5. click on Simplify or press ' '.
  224.  
  225. Now we have a fourth degree polynomial.  We know two of the roots: r, -r.  So
  226. we can reduce the equation by polynomial division.
  227.  1. copy (r^2 - x^2) to the key by clicking on the minus sign in (2) with
  228.     the right mouse button.  Keyboard: down, pgdn, pgdn, period, up.
  229.  2. click on Div Key or press '/'.
  230.  3. select the left side of (1).  Use the left mouse button, or press end.
  231.  4. copy an 'x' to the key.  Click on an 'x' with the right mouse button or
  232.     type 'k' 'x' F6 enter.
  233.     The purpose of this 'x' is to set the basis for division.  In this case
  234.     we want to divide two polynomials on the variable 'x'.  We could also
  235.     divide on 'r' and the result would be the same in this case.
  236.  5. click on Poly Div or press '\'.
  237.  
  238. Now you should see the quotient plus the remainder fraction.  In this case
  239. the remainder reduces to zero after you distribute and simplify.
  240.  1. click on Distribut or press 'd'.
  241.  2. click on Simplify or press ' '.
  242.  
  243. Since the quotient is a second degree polynomial, we can solve it with the
  244. quadratic equation.
  245.  1. click on FactQuad or press 'q'.
  246.  2. click on Simplify or press ' '.
  247.  3. Press shift 'D' to distribute each factor.  (if you press 'd' you would
  248.     essentially undo the factorization).
  249.  4. click on Calculate or press 'c'.
  250.  5. click on Simplify or press ' '.
  251.  
  252. At this point the roots of the equation are apparent.
  253.  
  254.                                      0.5
  255.                           / 2  2    \
  256.                           \a *r  - 1/
  257.                    x = ± ----------------
  258.                                 a
  259.  
  260. The next little formula just demonstrates some arithmetic with complex numbers.
  261. Select it and press 'c' to calculate.  Both sides should be equal.
  262.  
  263. The remainder of the alged.ae file contains some sample problems for you to
  264. play with.  The last set of equations is the basis of another program I wrote
  265. called Impact (available in /SimTel/msdos/simulatn I think).  It was wrestling
  266. with these equations for several hours that inspired be to write Alged.
  267.  
  268. If you enjoy Alged or have any suggestions, please send me an email.
  269. I do not want you to send me any money, but I like to get mail.
  270.  
  271.  "But because of his great love for us, God, who is rich in mercy, made us
  272.   alive with Christ even when we were dead in transgressions -- it is by
  273.   grace you have been saved.  And God raise us up with Christ and seated us
  274.   with him in the heavenly realms in Christ Jesus, in order that in the coming
  275.   ages he might show the incomparable riches of his grace, expressed in his
  276.   kindness to us in Christ Jesus.  For it is by grace you have been saved,
  277.   through faith -- and this not of yourselves, it is the gift of God -- not by
  278.   works, so that no one can boast.  For we are God's workmanship, created in
  279.   Christ Jesus to do good works, which God prepared in advance for us to do."
  280.   Ephesians 2.4-10 NIV
  281.  
  282. John Henckel       henckel@vnet.ibm.com
  283.